package com.huilian.iotbox.admin.wap.service;

import com.github.pagehelper.PageInfo;
import com.huilian.iotbox.data.common.ServerResponse;
import com.huilian.iotbox.data.dto.MerchantDto;
import com.huilian.iotbox.data.dto.UserDto;
import com.huilian.iotbox.data.po.Merchant;
import com.huilian.iotbox.data.vo.MerchantVo;
import com.huilian.iotbox.data.vo.UserInfo;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;

/**
 * @author 谢洛涛
 * @date 2021/3/22 9:48
 */
public interface MerchantService {
    ServerResponse merchantRegister(MerchantDto merchantDto, UserInfo userInfo) throws Exception;

    void merchantRegisterNotice(HttpServletRequest request) throws Exception;

    ServerResponse findMerchant(Integer type, UserInfo userInfo);

    ServerResponse findMerchantInfo(Merchant merchant) throws Exception;

    PageInfo findMerchantListByUserId(MerchantDto merchantDto) throws IOException, NoSuchAlgorithmException, NoSuchProviderException, KeyManagementException;

    MerchantVo findMerchantByOutTradeNo(Merchant merchant);

    Integer addMerchant(Merchant merchant);

    Integer updateMerchant(Merchant merchant);

    ServerResponse merchantReRegistration(MerchantDto merchantDto, UserInfo userInfo) throws IOException, NoSuchAlgorithmException, NoSuchProviderException, KeyManagementException;

    ServerResponse switchoverPayCompany(MerchantDto merchantDto) throws IOException, NoSuchAlgorithmException, NoSuchProviderException, KeyManagementException;

    ServerResponse updateSplit(MerchantDto merchantDto) throws IOException, NoSuchAlgorithmException, NoSuchProviderException, KeyManagementException, Exception;

    ServerResponse sendCode(MerchantDto merchantDto) throws Exception;

    ServerResponse codeVerify(MerchantDto merchantDto) throws Exception;


    /**
     * 查询商户号是否存在
     *
     * @return
     */
    MerchantVo findByUserIdAndMerchantId(MerchantDto merchantDto);

    ServerResponse uploadphoto(MultipartFile image, String type) throws IOException;

    ServerResponse updateBankCard(MerchantDto merchantDto) throws IOException, NoSuchAlgorithmException, NoSuchProviderException, KeyManagementException;

    ServerResponse updateMerchantShortName(MerchantDto merchantDto) throws IOException, NoSuchAlgorithmException, NoSuchProviderException, KeyManagementException;

    ServerResponse getUncommittedMerchantInfo(UserInfo userInfo);

    ServerResponse updateUncommittedMerchantInfo(UserInfo userInfo, MerchantDto merchantDto);

    ServerResponse getUncommittedSubAccountMerchantInfo(UserInfo userInfo);

    ServerResponse updateUncommittedSubAccountMerchantInfo(UserInfo userInfo, MerchantDto merchantDto);

    ServerResponse merchantRegisterUploadByApplet(MultipartFile file, String photoType) throws Exception;

    ServerResponse merchantRegisterByApplet(MerchantDto merchantDto, UserInfo userInfo) throws IOException, NoSuchAlgorithmException, NoSuchProviderException, KeyManagementException;

    ServerResponse findMerchantInfoByApplet(Merchant merchant) throws Exception;

    ServerResponse sendCodeByApplet(MerchantDto merchantDto) throws IOException, NoSuchAlgorithmException, NoSuchProviderException, KeyManagementException;

    ServerResponse codeVerifyByApplet(MerchantDto merchantDto) throws IOException, NoSuchAlgorithmException, NoSuchProviderException, KeyManagementException;

    PageInfo findMerchantSubAccountByUserId(MerchantDto merchantDto) throws IOException, NoSuchAlgorithmException, NoSuchProviderException, KeyManagementException;

    ServerResponse subLedgerMerchantRegisterByApplet(MerchantDto merchantDto, UserInfo userInfo) throws Exception;

    ServerResponse findIdWhetherToImportBusiness(UserInfo userInfo) throws IOException, NoSuchAlgorithmException, NoSuchProviderException, KeyManagementException;


    ServerResponse findMerchantNameInfo(MerchantDto merchantDto) throws Exception;
    PageInfo findComplainData(MerchantDto merchantDto) throws Exception;
    ServerResponse findMerchantComplaintContent(MerchantDto merchantDto) throws Exception;

    ServerResponse complaintResponse(MerchantDto merchantDto) throws Exception;

    ServerResponse complaintComplete(MerchantDto merchantDto) throws Exception;

}
